import requests

url = "http://127.0.0.1:8000"
url_get = f"{url}/test"
head = {
    # "Content-Type": "application/text",
    "accept": "application/json",
}
data = "123456"

# 测试1: NG, 默认get方法不支持data携带数据
resp = requests.get(url_get, headers=head, data=data.encode())
print(resp.text)
print(resp.status_code)

# 测试2: OK, 在url中携带data数据
url_get = f"{url}/test/{data}"
resp = requests.get(url_get, headers=head)
print(resp.text)
print(resp.status_code)
